import request from "@/utils/request";
import { ParseData } from "@/utils/utils";

//获取供应商列表分页
export const GetProviderList = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang?${ParseData(data)}`,
  });
};
//获取供应商下拉列表
export const GetProviderOptions = () => {
  return request({
    method: "GET",
    url: `/gongyingshang/xialaliebiao`,
  });
};
//审核
export const ReviewProvider = (data: any) => {
  return request({
    method: "PUT",
    url: `/gongyingshang/shenhe`,
    data
  });
};
//备注
export const NoteProvider = (data: any) => {
  return request({
    method: "PUT",
    url: `/gongyingshang/beizhu`,
    data
  });
};
//新建供应商
export const AddProvider = (data: any) => {
  return request({
    method: "POST",
    url: `/gongyingshang`,
    data,
  });
};
//编辑供应商
export const EditProvider = (data: any) => {
  return request({
    method: "PUT",
    url: `/gongyingshang`,
    data,
  });
};
//供应商编辑查看
export const GetEditProvider = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/${data.id}`,
  });
};
//供应商详情查看
export const GetDetailProvider = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xiangqing/${data.id}`,
  });
};
//供应商详情认证信息
export const GetProviderCertification = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xiangqing/renzheng?${ParseData(data)}`,
  });
};
//供应商详情人员信息
export const GetProviderPeople = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xiangqing/renyuan?${ParseData(data)}`,
  });
};
//供应商详情人员添加
export const AddProviderPeople = (data: any) => {
  return request({
    method: "POST",
    url: `/gongyingshang/xiangqing/renyuan`,
    data
  });
};
//供应商详情人员删除
export const DeleteProviderPeople = (data: any) => {
  return request({
    method: "DELETE",
    url: `/gongyingshang/xiangqing/renyuan/${data.id}`,
  });
};
// 供应商详情-选择负责人分页
export const GetProviderPeopleList = (data: any) => {
  return request({
    method: "GET",
    url: `/zhuanjia/xuanze?${ParseData(data)}`,
  });
};
//供应商详情-业绩信息分页
export const GetProviderAchievement = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xiangqing/yeji?${ParseData(data)}`,
  });
};
// 供应商详情-添加项目
export const AddProviderAchievement = (data: any) => {
  return request({
    method: "POST",
    url: `/gongyingshang/xiangqing/yeji`,
    data,
  });
};
//供应商详情-业绩删除
export const DeleteProviderAchievement = (data: any) => {
  return request({
    method: "DELETE",
    url: `/gongyingshang/xiangqing/yeji/${data.id}`,
  });
};
//供应商详情-商品信息分页
export const GetProviderGoods = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xiangqing/shangpin?${ParseData(data)}`,
  });
};
// 供应商导入
export const ProviderUpload = (data: any) => {
  return request({
    method: "POST",
    url: `/gongyingshang/daoru`,
    data
  });
};
